<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page import="java.util.*, pl.edu.agh.bd2.domain.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Find student</title>
</head>
<body>
	<center>
		<h1>Find student</h1>
		<form method="post" action="/webRegister/findStudentServlet.do">
			<select name="selectedStudent" size="10">
				<%for(Subject subject : (HashSet<Subject>)session.getAttribute("subjects")){
					if(subject.getName().equals((String)session.getAttribute("selectedSubject"))){
						for(Student student : subject.getStudents()){						
				%>
					<option><%=(student.getFirstName() + " " + student.getLastName())%></option>
				<%		}
						break;
					} 
				}%>	
			</select>	
			<br><tr><td colspan="2"><input type="submit" id="student" value="select"/></td></tr>							
		</form>	
	</center>
</body>
</html>